//package com.cn.hadoop.TQ;
//
//import org.apache.hadoop.io.IntWritable;
//import org.apache.hadoop.io.Text;
//import org.apache.hadoop.mapreduce.Reducer;
//
//import java.io.IOException;
//
//public class TReduce extends Reducer<TQ, IntWritable, Text, IntWritable> {
//    Text text = new Text();
//    IntWritable i = new IntWritable();
//
//    @Override
//    protected void reduce(TQ key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
////全量的数据
//        //        for (IntWritable v : values) {
////            int year = key.getYear();
////            int month = key.getMonth();
////            int day = key.getDay();
////            int temperature = key.getTemperature();
////            text.set(year + "-" + month + "-" + day + "温度：" + temperature);
////            i.set(temperature);
////            context.write(text, i);
////        }
//        //同组（相同年月，前面的分组比较）的只取前两条
//        int j = 0;
//        for (IntWritable v : values) {
//            if (j >= 2) {
//                break;
//            }
//            int year = key.getYear();
//            int month = key.getMonth();
//            int day = key.getDay();
//            int temperature = key.getTemperature();
//            text.set(year + "-" + month + "-" + day + "温度：" + temperature);
//            i.set(temperature);
//            context.write(text, i);
//            j++;
//        }
//    }
//}
